﻿@{
    Layout = "~/Views/Shared/Home/_Layout.cshtml";
}

@{
    ViewBag.Title = "BabyToys";
   
}
@model IEnumerable<BabyToys.Models.SanPham>
<div class="content">
    <div class="content-left">
        @{Html.RenderAction("ModuleDanhMuc", "Home");}
        <br />
        @{Html.RenderAction("ModuleThuongHieu", "Home");}

        <br />
        @{Html.RenderAction("ModuleSanPhamNoiBat", "Home");}
    </div>
    <div class="content-right">
        @RenderPage("~/Views/Shared/Home/_ModuleSlider.cshtml")
        <div class="list1"></div>
        <h1>Sản phẩm mới</h1>
        
        <div class="endtitle"></div>
        @foreach (var sanpham in @Model)
        {
            <div class="box-product">
                   @if (sanpham.GiaKhuyenMai() > 0)
                {
                     <div  class="price-KM"><img src="~/Content/Images/KM.gif"/></div>
                }
                else
                {
                         <div  class="price-KM"></div>
                }
                <div class="image-product">
                    <img src="~/Content/Images/SanPham/@sanpham.HinhDaiDien" style="width:160px;height:160px;" />
                </div>
                <div class="name">
                    @{string title=BabyToys.Utilities.EditString.BoDauTrenChuoi(sanpham.TenSP);}
                    @Html.ActionLink(sanpham.TenSP,"ChiTiet","SanPham",new{id=sanpham.IdSanPham,slug=title},null)
                </div>
                <div class="price">
                    @if (sanpham.GiaKhuyenMai() > 0)
                    {
                        <span class="price-old">@sanpham.Gia Đ</span>
                        <span class="price-new">@sanpham.GiaKhuyenMai() Đ</span>
                    }
                    else
                    {
                        <span class="price-new">@sanpham.Gia Đ</span>
                    }
                </div>
                    @if (@sanpham.SoLuong() != 0)
                {
                    @Html.ActionLink("Thêm giỏ hàng", "ThemVaoGioHang", "GioHang", new { idsanpham = sanpham.IdSanPham, soluong = 1 }, new {@class="purple button dlLight" })
                }
                else {
                    <div class="addcart" style="color:#ed339f; margin-bottom:30px; font-size:14px">
                     Hết hàng
                 </div>
                    }
                
            </div>
        }
    </div>
    <div class="clear"></div>
</div>
